<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>蓝源进销存(教学版)-系统登录页</title>
<script>
	$(function() {
		$("#login_ok").click(function() {
			$("form:first").submit();
		});
		
		$("#loginForm input").blur(function(){
			//离开焦点的值
			var val= $.trim($(this).val());
			var inputName = $(this).attr("name");
			if(val == null || val == ""){
				if(inputName == "emp.username"){
					$("#errorTip").html("请输入用户名");
					$("#errorTip").show(300);
				}
				if(inputName == "emp.password"){
					$("#errorTip").html("请输入用密码");
					$("#errorTip").show(300);
				}
				if(inputName == "captcha"){
					$("#errorTip").html("请输入用验证码");
					$("#errorTip").show(300);
				}
			}else{
				$("#errorTip").hide(300);
			}
		
		})
		
		var tip = $("#errorTipHide").val();
		tip = $.trim(tip);
		if(tip != "" && tip != null){
			$("#errorTipTd").show();
		}
		$("#errorTipTd").html(tip);
	});
	function changeCap(){
		var path = "${path}/emp_getImage?date="+new Date();
		//alert(path)
		//获得验证码的img
		$("#cap").attr("src",path);
	}
	
	
</script>
</head>
<body>

	<div class="container-login">
		<div class="login-pic">
			<div class="login-text">
				
				<form id="loginForm" action="${path }/emp_login" method="post">
				
					
					<input id="errorTipHide" type="hidden" value="<s:property value="errorTip"/>"/>
					<table width="100%" border="0" cellpadding="0" cellspacing="0">
						<tr>
							
							<td id="errorTipTd" colspan="3" align="center" style="padding:3px; border: 1px solid #FEF5AE;display:none; background-color: #FFFBE6;">
								
								
							</td>
							
						</tr>
						<tr>
							<td  >用户名：</td>
							<td colspan="2">
								<s:textfield  name="emp.username" size="18"></s:textfield>
							</td>
						</tr>
						<tr>
							<td >密&nbsp;&nbsp;码：</td>
							<td colspan="2">
								<s:textfield type="password" name="emp.password" size="18"></s:textfield>
							</td>
						</tr>
						<tr>
							<td >验证码：</td>
							<td>
								<s:textfield name="captcha" size="9"></s:textfield>
							</td>
							<td width="32%"><img id="cap" src="${path }/emp_getImage" onclick="changeCap()"/>
							</td>
						</tr>
						<tr>
							<td height="30">&nbsp;</td>
							<td colspan="2">
								<a href="javascript:void(0)" id="login_ok">
									<img src="${path}/images/denglu_bg_03.gif" 
										 name="Image1" width="40"	
										 height="22" border="0"  
										 /></a>
								<a href="#">
									<img src="${path}/images/giveup_bg_03.gif" 
										 name="Image2" width="42" 
										 height="22" border="0"  
										 /></a>
							</td>
						</tr>
					</table>
				</form>
			</div>
		</div>
	</div>
</body>
</html>
